import org.kwis.msp.lcdui.*;
import org.kwis.msp.lwc.*;

public class XORTest extends Jlet
{
	protected void startApp(String args[]){
		Display dis = Display.getDefaultDisplay();
		dis.pushCard(new SampleCard());
        }
	protected void destroyApp(boolean b){
	}
};

class SampleCard extends Card
{
	boolean keyInput = false;

	public void paint(Graphics g)
	{
		if(keyInput==true) {
			g.setColor(0xffffff);
			g.setXORMode(true);
			g.fillRect(30,30,getWidth()/2,getHeight()/2);
			keyInput = false;
		}
	}

	protected boolean keyNotify(int type, int key) 
	{
		switch(Display.getGameAction(key)) 
		{
			case 2 : // LEFT KEY
				if (type == 1 ) // KEY PRESSED
				{
					keyInput = true;
					repaint();
				}
		}
		return true;
	}
};
